﻿<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<title>后台订单查询</title>
<meta name="keywords" content="后台模板,后台管理系统,HTML模板">
<meta name="description" content="基于Bootstrap后台管理系统的HTML模板">
<link href="../css/bootstrap.min.css" rel="stylesheet">
<link href="fonts.css" rel="stylesheet">
<link href="style.css" rel="stylesheet">
</head>
  
<body>

    <!--页面主要内容-->
    <main class="ftdms-layout-content">
      
      <div class="container-fluid" style="margin-bottom:90px;">
        
        <!--<div class="row" style="margin-top:15px;">-->
          <!--<div class="col-sm-6 col-lg-3">-->
            <!--<div class="card bg-primary">-->
              <!--<div class="card-body clearfix">-->
                <!--<div class="pull-left">-->
                  <!--<p class="h6 text-white m-t-0">今日收入</p>-->
                  <!--<p class="h3 text-white m-b-0">100,000.00</p>-->
                <!--</div>-->
                <!--<div class="pull-right"> <span class="img-avatar img-avatar-48 bg-translucent"><i class="ftsucai-56 fa-1-5x"></i></span> </div>-->
              <!--</div>-->
            <!--</div>-->
          <!--</div>-->
          <!---->
          <!--<div class="col-sm-6 col-lg-3">-->
            <!--<div class="card bg-danger">-->
              <!--<div class="card-body clearfix">-->
                <!--<div class="pull-left">-->
                  <!--<p class="h6 text-white m-t-0">昨日收入</p>-->
                  <!--<p class="h3 text-white m-b-0">200,000.00</p>-->
                <!--</div>-->
                <!--<div class="pull-right"> <span class="img-avatar img-avatar-48 bg-translucent"><i class="ftsucai-310 fa-1-5x"></i></span> </div>-->
              <!--</div>-->
            <!--</div>-->
          <!--</div>-->
          <!---->
          <!--<div class="col-sm-6 col-lg-3">-->
            <!--<div class="card bg-success">-->
              <!--<div class="card-body clearfix">-->
                <!--<div class="pull-left">-->
                  <!--<p class="h6 text-white m-t-0">月度累计收入</p>-->
                  <!--<p class="h3 text-white m-b-0">1000,000.00</p>-->
                <!--</div>-->
                <!--<div class="pull-right"> <span class="img-avatar img-avatar-48 bg-translucent"><i class="ftsucai-55 fa-1-5x"></i></span> </div>-->
              <!--</div>-->
            <!--</div>-->
          <!--</div>-->
          <!---->
          <!--<div class="col-sm-6 col-lg-3">-->
            <!--<div class="card bg-purple">-->
              <!--<div class="card-body clearfix">-->
                <!--<div class="pull-left">-->
                  <!--<p class="h6 text-white m-t-0">年度累计收入</p>-->
                  <!--<p class="h3 text-white m-b-0">5,000,000.00</p>-->
                <!--</div>-->
                <!--<div class="pull-right"> <span class="img-avatar img-avatar-48 bg-translucent"><i class="ftsucai-310 fa-1-5x"></i></span> </div>-->
              <!--</div>-->
            <!--</div>-->
          <!--</div>-->
        <!--</div>-->




        
        <!--<div class="row">
          
          <div class="col-lg-6"> 
            <div class="card">
              <div class="card-header">
                <h4>近七天收入</h4>
              </div>
              <div class="card-body">
                <canvas class="js-chartjs-bars"></canvas>
              </div>
            </div>
          </div>
          
          <div class="col-lg-6"> 
            <div class="card">
              <div class="card-header">
                <h4>每月收入走势</h4>
              </div>
              <div class="card-body">
                <canvas class="js-chartjs-lines"></canvas>
              </div>
            </div>
          </div>
           
        </div>

		<div class="row">
          
          <div class="col-lg-6"> 
            <div class="card">
              <div class="card-header">
                <h4>每月收入</h4>
              </div>
              <div class="card-body">
                <canvas class="chartjs-bars"></canvas>
              </div>
            </div>
          </div>
          
          <div class="col-lg-6"> 
            <div class="card">
              <div class="card-header">
                <h4>每年收入走势</h4>
              </div>
              <div class="card-body">
                <canvas class="chartjs-lines"></canvas>
              </div>
            </div>
          </div>
           
        </div>-->
        <div class="order">
          <div class="top">
            <span>订单查询：</span>
            <select name="" id="aa">
              <option value="0">今日订单</option>
              <option value="3">三天内订单</option>
              <option value="7">七天内订单</option>
            </select>
            <button onclick="selectOrder()">查询</button>
          </div>
        </div>

        <div class="row">
          <div class="col-lg-12">
            <div class="card">
              <div class="card-body">
                <div class="table-responsive">
                  <table class="table table-hover">
                    <thead>
                      <tr>
                        <th>#</th>
                        <th>订单号</th>
                        <th>下单日期</th>
                        <th>用户ID</th>
                        <th>商品ID</th>
                        <th>订单价格</th>
                        <th>状态</th>
                        <th>数量</th>
                        <th>地址</th>
                        <th>操作</th>
                      </tr>
                    </thead>
                    <tbody id="table">
                      <!--<tr>
                        <td>1</td>
                        <td></td>
                        <td>黑色休闲裤</td>
                        <td>2019-05-01</td>
                        <td><span class="label label-warning">完成</span></td>
                        <td>
                          <div class="progress progress-striped progress-sm">
                            <div class="progress-bar progress-bar-warning" style="width: 45%;"></div>
                          </div>
                        </td>
                      </tr>
                      <tr>
                        <td>2</td>
                        <td>23534536</td>
                        <td>黑色休闲裤</td>
                        <td>2019-05-01</td>
                        <td><span class="label label-success">发货中</span></td>
                        <td>
                          <div class="progress progress-striped progress-sm">
                            <div class="progress-bar progress-bar-success" style="width: 30%;"></div>
                          </div>
                        </td>
                      </tr>
                      <tr>
                        <td>3</td>
                        <td>23534536</td>
                        <td>黑色休闲裤</td>
                        <td>2019-05-01</td>
                        <td><span class="label label-warning">待确认</span></td>
                        <td>
                          <div class="progress progress-striped progress-sm">
                            <div class="progress-bar progress-bar-warning" style="width: 25%;"></div>
                          </div>
                        </td>
                      </tr>
                      <tr>
                        <td>4</td>
                        <td>23534536</td>
                        <td>黑色休闲裤</td>
                        <td>2019-05-01</td>
                        <td><span class="label label-success">发货中</span></td>
                        <td>
                          <div class="progress progress-striped progress-sm">
                            <div class="progress-bar progress-bar-success" style="width: 55%;"></div>
                          </div>
                        </td>
                      </tr>
                      <tr>
                        <td>5</td>
                        <td>23534536</td>
                        <td>黑色休闲裤</td>
                        <td>2019-05-01</td>
                        <td><span class="label label-danger">待确认</span></td>
                        <td>
                          <div class="progress progress-striped progress-sm">
                            <div class="progress-bar progress-bar-danger" style="width: 0%;"></div>
                          </div>
                        </td>
                      </tr>
                      <tr>
                        <td>6</td>
                        <td>23534536</td>
                        <td>黑色休闲裤</td>
                        <td>2019-05-01</td>
                        <td><span class="label label-success">发货中</span></td>
                        <td>
                          <div class="progress progress-striped progress-sm">
                            <div class="progress-bar progress-bar-success" style="width: 75%;"></div>
                          </div>
                        </td>
                      </tr>
                      <tr>
                        <td>7</td>
                        <td>23534536</td>
                        <td>黑色休闲裤</td>
                        <td>2019-05-01</td>
                        <td><span class="label label-danger">已取消</span></td>
                        <td>
                          <div class="progress progress-striped progress-sm">
                            <div class="progress-bar progress-bar-danger" style="width: 15%;"></div>
                          </div>
                        </td>
                      </tr>
                      <tr>
                        <td>8</td>
                        <td>23534536</td>
                        <td>黑色休闲裤</td>
                        <td>2019-05-01</td>
                        <td><span class="label label-warning">完成</span></td>
                        <td>
                          <div class="progress progress-striped progress-sm">
                            <div class="progress-bar progress-bar-success" style="width: 100%;"></div>
                          </div>
                        </td>
                      </tr>-->
                    </tbody>
                  </table>
                </div>
              </div>
            </div>
          </div>
        </div>


        <div class="bbb">
          <span>销售额查询：</span>
          <input type="date" id="bb">
          <span>至</span>
          <input type="date" id="cc">
          <button onclick="checkMoney()">查询</button>
        </div>
        <div>
          <table class="table table-hover" >
            <tr>
              <th>订单日期</th>
              <th>销售金额</th>
            </tr>
            <tbody id="money">
            <!--<tr>
              <td>2020-12-25</td>
              <td>￥9999</td>
            </tr>-->
            </tbody>
          </table>
        </div>
        
      </div>
      
    </main>
    <!--End 页面主要内容-->

<script type="text/javascript" src="../js/jquery.min.js"></script>

    <script>
      function selectOrder() {
        /*var a = document.getElementById("aa").value*/
        var time = $("#aa").val()
       $.getJSON("http://localhost:8080/selectClassify?time=" + time,function (data) {
         var html = ''
         if (data.code==0){
           console.log(data)
           for(let i=0; i< data.data.length;i++){
             html +=`
            <tr>
                <td>${data.data[i].orderId}</td>
                <td>${data.data[i].orderNo}</td>
                <td>${data.data[i].orderDate}</td>
                <td>${data.data[i].orderUserId}</td>
                <td>${data.data[i].orderGoodId}</td>
                <td>${data.data[i].orderMoney}</td>
                <td>${data.data[i].orderState}</td>
                <td>${data.data[i].orderCount}</td>
                <td>${data.data[i].reserve2}</td>
                <td>${data.data[i].reserve3}</td>
             </tr>
            `
             $("#table").html(html)
           }
         }else {
           $("#table").html('')
         }
       })
      }


      function checkMoney() {
        var b = $("#bb").val()
        var c = $("#cc").val()
        $.getJSON("http://localhost:8080/selectOrderMoney?orderDate1=" + b + "&orderDate2=" + c,function (data) {
          var html = ''
          for(let i=0; i< data.length;i++){
            html +=`
            <tr>
              <td>${data[i].orderDate}</td>
              <td>${data[i].sum}</td>
            </tr>
            `
            $("#money").html(html)
          }
        })

      }
    </script>
</body>
</html>